import 'package:flutter/material.dart';
import 'package:xmshop/app/serives/screenAdapter.dart';

class passTextFiled extends StatelessWidget {
  final bool isPassWord;
  final String hintText;
  final TextInputType? keyboardType;
  final TextEditingController? controller;
  final Function(String)? onChanged;

  const passTextFiled(
      {super.key,
      this.controller,
      this.isPassWord = false,
      this.keyboardType = TextInputType.number,
      required this.hintText,
      this.onChanged});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      height: ScreenAdapter.height(180),
      margin: EdgeInsets.only(top: ScreenAdapter.height(100)),
      padding: EdgeInsets.only(left: ScreenAdapter.width(40)),
      decoration: BoxDecoration(
          color: Colors.black12, borderRadius: BorderRadius.circular(20)),
      child: TextField(
        controller: controller,
        obscureText: isPassWord,
        style: TextStyle(fontSize: ScreenAdapter.fontSize(36)),
        keyboardType: keyboardType,
        decoration:
            InputDecoration(hintText: hintText, border: InputBorder.none),
        onChanged: onChanged,
      ),
    );
  }
}
